#include"Mystdio.h"
#include<unistd.h>
#define myfile "test.txt"

//实现四个接口
int main()
{
    _FILE *fp = _fopen(myfile,"a");//模拟实现函数前加'_' 以区分库函数
    
    if(fp == NULL) return 1;
    int cnt = 10;
    const char* msg = "hello fx\n";
    while(cnt--)
    {
        _fwrite(fp,msg,strlen(msg));

//    fflush(fp);
    
        sleep(1);
    }
    _fclose(fp);
    
    return 0;
}
